<template>
  <div>
    <ul>
      <li v-for="(item, index) in arr" :key="index">{{ item }}</li>
    </ul>
    <button @click="fn">走一走</button>
  </div>
</template>

<script>
// 视图写好，再写JS业务逻辑 先静后动
export default {
  data() {
    return {
      arr: ["美女", "程序员", "帅哥"],
    };
  },
  methods: {
    fn() {
      const first = this.arr.shift();
      this.arr.push(first);
    },
  },
};
</script>

<style scoped></style>
